<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>9-05 变换矩阵</title>
</head>
<body>
  <canvas id="c" width="600" height="600" style="border: 1px solid #ccc;"></canvas>

  <script>
    const context = document.getElementById('c')
    const ctx = context.getContext('2d')

    // 变换矩阵
    ctx.setTransform(1, 1, 1, 2, 30, 40)

    // 绘制矩形
    ctx.fillRect(10, 10, 100, 100)
  </script>
</body>
</html>